import {
  request
} from './request'


export function getMenuList() {
  return request({
    url: '/menus',
    method: 'get',

  })
}

// 列表数据

export function getUserList(query, pagenum, pagesize) {
  return request({
    url: '/users',
    method: 'get',
    params: {
      query, pagenum, pagesize
    }

  })
}

// 开关按钮


export function getUserState(uId, type) {
  return request({
    url: `/users/${uId}/state/${type}`,
    method: 'put',
    params: {
      uId, type
    }

  })
}
// 添加用户

export function postUserinfo(username, password, email, mobile) {
  return request({
    url: '/users',
    method: 'post',
    params: {
      username, password, email, mobile
    }

  })
}

// 修改用户
export function editUserinfo(id) {
  return request({
    url: `/users/${id}`,
    method: 'get',
    params: {
      id
    }

  })
}

// 编辑用户提交

export function editUserinfoBtn(id, email, mobile) {
  return request({
    url: `/users/${id}`,
    method: 'put',
    params: {
      id, email, mobile
    }

  })
}

// 删除用户

export function deleteUser(id) {
  return request({
    url: `/users/${id}`,
    method: 'delete',
    params: {
      id
    }

  })
}

